<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.translation.dao.Selector"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.SQLException"%>
<%@page import="com.translation.dao.BaseDAO"%>
<%@page import="com.translation.util.Util"%>
<%@page import="javax.servlet.jsp.JspWriter"%>
<%@page import="java.io.IOException"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Session Locale</title>
</head>
<body>
<%
        final String locale_id = Util.toNull(request.getParameter("locale_id"));
        if (locale_id != null) {
            session.setAttribute("locale_id",locale_id);   
        }
%>
    <form action="locale.jsp">
        <table>
            <tr>
                <td>Locale: </td>
                <td>
                    <select name="locale_id">
                        <option></option>
                        <option value="es"<%= ("es".equals(locale_id)? "selected=\"selected\"":"") %>>ES</option>
                        <option value="fr"<%= ("fr".equals(locale_id)? "selected=\"selected\"":"") %>>FR</option>
                        <option value="de" <%= ("de".equals(locale_id)? "selected=\"selected\"":"") %>>DE</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="submit" name="submit"  value="Set Session Locale" />
                </td>
            </tr>
        </table>
    </form>
</body>
</html>